<template>
	<view>
		<view :class="item.clicked==1?'user-card-clicked':'user-card'" v-for="(item,index) in dataList"
			@click.stop="selected(index)">

			<view class="cover">


				<view class="info">

					<view class="text-1" style="margin-top: 15px;margin-bottom: 13px;">{{item.carConfigName}}</view>


					<view class="text-2">{{item.carConfigDescribe}}</view>

					<view class="text-3" @click.stop="watchMore(item)">查看更多
					</view>

					<view class="price" style="margin-top: 5px;margin-bottom: 19px;">￥{{item.carConfigMoney}}<text
							class="before" style="font-size: 12px;"></text></view>
				</view>


				<image  class="img"
					:src="item.carImgUrl||'@appstatic/img/my/appoint_img_small.png'">

			</view>
		</view>
		<view v-if="dataList.length==0">
			<view class='img-box'>
				<image class='emptyImage'
					src='@appstatic/img/my/my_order_no_data.png'></image>
				<view class='text'>暂无数据</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "carSeries",
		props: {
			configureList: {
				type: Array,
				default: () => {
					return []
				}
			}

		},
		data() {
			return {};
		},
		computed: {
			dataList: {
				get() {
					for (var i = 0; i < this.configureList.length; i++) {
						if (this.configureList[i].clicked == 1) {
							this.$emit('configureItem_watch', this.configureList[i])
						}
					}
					return this.configureList
				},
				set(v) {

				}

			}
		},
		methods: {
			selected: function(index) {
				for (var i = 0; i < this.dataList.length; i++) {
					if (index == i) {
						this.dataList[i].clicked = 1
						this.$emit('configureItem', this.dataList[i])
						// this.$emit('configureChoose')
					} else {
						this.dataList[i].clicked = 0
					}

				}

			},
			watchMore: function(item) {
				this.$emit('configureWatchMore', item.carConfigDescribe)
			},

		},
		options: {
			styleIsolation: 'shared'
		},
	}
</script>

<style lang='scss' scoped>
	.user-card-clicked {
		width: calc(100% - 30px);
		margin-top: 20rpx;
		height: 160px;
		margin-left: 15px;
		clip-path: polygon(15px 0, calc(100% - 15px) 0,

				100% 0px, 100% calc(100% - 15px),

				calc(100% - 15px) 100%, 0px 100%,

				0 calc(100% - 15px), 0 15px);

		background: linear-gradient(-45deg, #EA5404 10px, #EDEDED 0) bottom right,

			linear-gradient(45deg, #EA5404 0px, #EDEDED 0) bottom left,

			linear-gradient(135deg, #EA5404 10px, #EDEDED 0) top left,

			linear-gradient(-135deg, #EA5404 0px, #EDEDED 0) top right;

		background-size: 52% 52%;
		background-repeat: no-repeat;
		border: solid 2px #EA5404;


	}

	.user-card {
		width: calc(100% - 30px);
		margin-top: 20rpx;
		height: 160px;
		margin-left: 15px;
		clip-path: polygon(15px 0, calc(100% - 15px) 0,

				100% 0px, 100% calc(100% - 15px),

				calc(100% - 15px) 100%, 0px 100%,

				0 calc(100% - 15px), 0 15px);

		background: linear-gradient(-45deg, #EDEDED 10px, #EDEDED 0) bottom right,

			linear-gradient(45deg, #EDEDED 0px, #EDEDED 0) bottom left,

			linear-gradient(135deg, #EDEDED 10px, #EDEDED 0) top left,

			linear-gradient(-135deg, #EDEDED 0px, #EDEDED 0) top right;

		background-size: 52% 52%;
		background-repeat: no-repeat;
		border: solid 2px #EDEDED;


	}

	.cover {
		width: 100%;
		height: 160px;
		z-index: 2;
		display: flex;

	}



	.info {
		width: calc(100% - 180px);
		height: 100%;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: center;
		margin-left: 20px;
		margin-right: 10px;

	}

	.text-1 {
		font-family: 'Arial';
		font-style: normal;
		font-weight: 700;
		font-size: 18px;
		line-height: 21px;
		display: flex;
		align-items: center;
		color: #3D3A3A;
	}

	.text-2 {
		font-family: 'Noto Sans CJK SC';
		font-style: normal;
		font-weight: 400;
		font-size: 12px;
		line-height: 18px;
		display: flex;
		align-items: center;
		color: #333333;
		opacity: 0.4;


		width: calc(100% - 15px);
		overflow: hidden !important;
		text-overflow: ellipsis !important;
		display: -webkit-box !important;
		-webkit-line-clamp: 1; //文字上限行
		-webkit-box-orient: vertical;
	}

	.price {
		font-style: normal;
		font-weight: 400;
		font-size: 14px;
		line-height: 18px;
		display: flex;
		align-items: center;
		color: #3D3A3A;
	}


	.before:before {
		content: " ";
		white-space: pre;

	}

	.before1:before {
		content: "   ";
		white-space: pre;

	}

	.img {
		width: 180px;
		height: 160px;
		clip-path: polygon(0px 0, calc(100% - 15px) 0,

				100% 0px, 100% calc(100% - 15px),

				calc(100% - 15px) 100%, 0px 100%,

				0 calc(100% - 15px), 0 15px);
	}

	.img-box {
		width: 100vw;
		/* margin-left: calc(50% - 150rpx); */
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.emptyImage {
		width: 300rpx;
		height: 300rpx;
		margin-top: 50px;
	}

	.text {
		text-align: center;
		font-size: 28rpx;
		line-height: 5px;
		color: #ADB0AE;
	}

	.text-3 {
		font-family: 'Noto Sans SC';
		font-style: normal;
		font-weight: 400;
		font-size: 12px;
		line-height: 17px;
		display: flex;
		align-items: center;
		color: #EA5404;
		margin-top: 5px;
		margin-bottom: 8px;
		margin-right: 20px;
	}
</style>
